package SceneBegin;

import Picture.GameImage;
import Player.MusicPlayer;

import javax.swing.*;
import java.awt.*;


public class BeginPanel extends JPanel {
    public class playThread extends  Thread{
        @Override
        public void run() {
            while (true)
            musicPlayer.play();
        }
    }

    Scene scene = new Scene();
    public  MusicPlayer musicPlayer = new MusicPlayer("/music/begin.mp3");

    playThread playThread = new playThread();
    public BeginPanel() {
        playThread.start();
    }
    public void paint(Graphics g){{
        super.paint(g);
        g.drawImage(scene.map.get("bg"),0,0,null);
        //版式一
     /*   g.drawImage(scene.map.get("开始游戏"),230,800,null);
        g.drawImage(scene.map.get("C"),0,300,null);
        g.drawImage(scene.map.get("元素的奇妙"),140,300,null);
        g.drawImage(scene.map.get("冒险"),220,400,null);*/

        //版式二
        g.drawImage(scene.map.get("开始游戏"),230,800,null);
        g.drawImage(scene.map.get("2C"),80,300,null);
        g.drawImage(scene.map.get("2元素"),220,400,null);
        g.drawImage(scene.map.get("的"),320,300,null);
        g.drawImage(scene.map.get("奇"),0,450,null);
        g.drawImage(scene.map.get("妙"),200,500,null);
        g.drawImage(scene.map.get("冒"),340,450,null);
        g.drawImage(scene.map.get("险"),480,450,null);


    }

    }
}
